/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 *
 * @author zinin
 */
class Rect {
    private int posx;
    private int posy;
    private int width;
    private int height;

    
    Rect(int x, int y, int aWidth, int aHeight) {
        posx = x;
        posy = y;
        width = aWidth;
        height = aHeight;
    }
    
    public boolean contains(int x, int y){
        return (x > posx && x < (posx + width) && y > posy && y < posy + height);
    }
    
    public void expand(int factor){
        posx -= factor / 2;
        posy -= factor / 2;
        width += factor;
        height += factor;
    } 
}
